import QtQuick 2.0
import QtQuick.Controls 2.5
import QtQuick.Templates 2.5 as T
import QtQuick.Shapes 1.12

T.ToolButton {

    id:control
    property alias arrow: arrow
    property string svgPath
    property var childMenu
    property string textName
    property var showType
    property alias toolButtonWidth: toolButton.width
    property alias toolButtonHeight: toolButton.height
    //property size imageSize

    //控制多个控件分开
    implicitWidth: childrenRect.x + childrenRect.width
    implicitHeight: childrenRect.y + childrenRect.height

    Column{
        id: column

        ToolButton{
            id: toolButton
                    icon.source: svgPath
                    text: textName
                    padding: 0 //不加 不会显示
                    display: showType
                    onClicked:childMenu.popup(this, x, y+parent.height)
                }

        Image {
            id: arrow
            width: 10
            height: 10
            anchors.horizontalCenter: parent.horizontalCenter
            visible: false
            source: "qrc:/image/myDown.svg"
            fillMode: Image.PreserveAspectFit
            horizontalAlignment: Image.AlignHCenter
        }

    }


//        contentItem:ToolButton{
//            icon.source: svgPath
//            ToolTip.text: tipText
//            text: textName
//            padding: 0
//            display: showType
//            onClicked:childMenu.popup(this, x, y+parent.height)
//        }

//        Image {
//            id: arrow
//            width: parent.width
//            visible: false
//            source: "qrc:/image/myDown.svg"
//            fillMode: Image.PreserveAspectFit
//            horizontalAlignment: Image.AlignHCenter
//        }

}



/*##^##
Designer {
    D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
